package com.sloera.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author sloera
 * @create 2020/4/27
 */
@Getter
@AllArgsConstructor
public enum CountryEnum {
    /**
     * 齐
     */
    ONE(1, "齐"),
    /**
     * 楚
     */
    TWO(2, "楚"),
    /**
     * 燕
     */
    THREE(3, "燕"),
    /**
     * 赵
     */
    FOUR(4, "赵"),
    /**
     * 魏
     */
    FIVE(5, "魏"),
    /**
     * 韩
     */
    SIX(6, "韩");
    private Integer retCode;
    private String retMessage;

    public static CountryEnum forEachCountryEnum(int index) {
        CountryEnum[] countryEnums = CountryEnum.values();
        for (CountryEnum country : countryEnums) {
            if (index == country.getRetCode()) {
                return country;
            }
        }
        return null;
    }
}
